<template>
  <div class="app-container home">
<!--    <el-row :gutter="20">
      <el-col :sm="24" :lg="24">
        <blockquote class="text-warning" style="font-size: 14px">
          嘉兆-应变泄漏监测管理系统-开发中
          <br />
          <el-link
              href="https://www.cazor.com.cn/"
              type="primary"
              target="_blank"
          >https://www.cazor.com.cn/</el-link
          >
          <br />

          <h4 class="text-danger">
            开发测试中。(仅限新用户)
          </h4>
        </blockquote>

        <hr />
      </el-col>
    </el-row>-->
    <el-row :gutter="20">
      <el-col :sm="24" :lg="24" style="padding-left: 20px">
        <h2>数据接口监控</h2>
        <el-table v-loading="jobMonitorLoading" :data="jobMonitorList" >
          <el-table-column label="光纤通道编号" align="center" prop="fiberNum" width="110px"/>
          <el-table-column label="光纤通道名称" align="center" prop="fiberName" :show-overflow-tooltip="true"/>
          <el-table-column label="传感器id编号" align="center" prop="sensorId" width="110px"/>
          <el-table-column label="传感器名称" align="center" prop="sensorName" />
          <el-table-column label="传感器名称" align="center" prop="sensorName" />
          <el-table-column label="最近导入时间" align="center" prop="lastInputTime" />
          <el-table-column label="最近分析时间" align="center" prop="updateTime" />
        </el-table>
        <p>
          <el-button type="primary" icon="Refresh" plain @click="doJboMonitor" >刷 新</el-button>
        </p>
      </el-col>
    </el-row>
    <el-divider />
    <el-row :gutter="20">
<!--      <el-col :sm="24" :lg="24" style="padding-left: 50px">-->
      <el-col :sm="24" :lg="24" style="padding-left: 20px">
        <h2>主机联通测试</h2>
        <el-table v-loading="hostConnectionLoading" :data="hostConnectionList" >
          <el-table-column label="主机序号" align="center" prop="hostInfo.hostId" width="110px"/>
          <el-table-column label="主机编号" align="center" prop="hostInfo.hostNo" width="110px"/>
          <el-table-column label="主机名称" align="center" prop="hostInfo.hostName" width="120px" :show-overflow-tooltip="true"/>
          <!--          <el-table-column label="光纤通道编号" align="center" prop="hostInfo" width="110px"/>-->
          <!--          <el-table-column label="光纤通道名称" align="center" prop="fiberName" :show-overflow-tooltip="true"/>-->
          <!--          <el-table-column label="传感器id编号" align="center" prop="sensorId" width="110px"/>-->
          <el-table-column label="状态" align="center" prop="status" width="90px"/>
          <el-table-column label="耗时" align="center" prop="takeTime" width="110px" />
          <el-table-column label="消息" align="center" prop="msg" :show-overflow-tooltip="true"/>
          <!--          <el-table-column label="最近导入时间" align="center" prop="lastInputTime" />-->
          <el-table-column label="测试时间" align="center" prop="testTime" />
        </el-table>
        <p>
          <el-button type="primary" icon="Refresh" plain @click="doHostConnectionTest" >刷 新</el-button>
        </p>
      </el-col>
<!--      <el-col :xs="24" :sm="24" :md="12" :lg="24">
        <el-collapse accordion>
          <el-collapse-item title="测试线路-&#45;&#45;1">
            <el-tabs type="border-card" class="demo-tabs">
              <el-tab-pane label="第一分段">

              </el-tab-pane>
              <el-tab-pane label="第二分段">Config</el-tab-pane>
              <el-tab-pane label="第三分段">Role</el-tab-pane>
              <el-tab-pane label="第四分段">Task</el-tab-pane>
            </el-tabs>
          </el-collapse-item>
        </el-collapse>
      </el-col>-->
<!--      <el-col :xs="24" :sm="24" :md="12" :lg="24">
        <el-card class="update-log">
          <template v-slot:header>
            <div class="clearfix">
              <span>测试线路</span>
            </div>
          </template>
          <div class="body">

          </div>
        </el-card>
      </el-col>-->
<!--      <el-col :xs="24" :sm="24" :md="12" :lg="8">
        <el-card class="update-log">
          <template v-slot:header>
            <div class="clearfix">
              <span>更新日志</span>
            </div>
          </template>
          <el-collapse accordion>
            <el-collapse-item title="v3.8.5 - 2023-01-01">
              <ol>
                <li>定时任务违规的字符</li>
                <li>重置时取消部门选中</li>
                <li>新增返回警告消息提示</li>
                <li>忽略不必要的属性数据返回</li>
                <li>修改参数键名时移除前缓存配置</li>
                <li>导入更新用户数据前校验数据权限</li>
                <li>兼容Excel下拉框内容过多无法显示的问题</li>
                <li>升级echarts到最新版本5.4.0</li>
                <li>升级core-js到最新版本3.25.3</li>
                <li>升级oshi到最新版本6.4.0</li>
                <li>升级kaptcha到最新版2.3.3</li>
                <li>升级druid到最新版本1.2.15</li>
                <li>升级fastjson到最新版2.0.20</li>
                <li>升级pagehelper到最新版1.4.6</li>
                <li>优化弹窗内容过多展示不全问题</li>
                <li>优化swagger-ui静态资源使用缓存</li>
                <li>开启TopNav没有子菜单隐藏侧边栏</li>
                <li>删除fuse无效选项maxPatternLength</li>
                <li>优化导出对象的子列表为空会出现[]问题</li>
                <li>优化编辑头像时透明部分会变成黑色问题</li>
                <li>优化小屏幕上修改头像界面布局错位的问题</li>
                <li>修复代码生成勾选属性无效问题</li>
                <li>修复文件上传组件格式验证问题</li>
                <li>修复回显数据字典数组异常问题</li>
                <li>修复sheet超出最大行数异常问题</li>
                <li>修复Log注解GET请求记录不到参数问题</li>
                <li>修复调度日志点击多次数据不变化的问题</li>
                <li>修复主题颜色在Drawer组件不会加载问题</li>
                <li>修复文件名包含特殊字符的文件无法下载问题</li>
                <li>修复table中更多按钮切换主题色未生效修复问题</li>
                <li>修复某些特性的环境生成代码变乱码TXT文件问题</li>
                <li>修复代码生成图片/文件/单选时选择必填无法校验问题</li>
                <li>修复某些特性的情况用户编辑对话框中角色和部门无法修改问题</li>
                <li>其他细节优化</li>
              </ol>
            </el-collapse-item>

            <el-collapse-item title="v1.0.0 - 2019-10-08">
              <ol>
                <li>若依前后端分离系统正式发布</li>
              </ol>
            </el-collapse-item>
          </el-collapse>
        </el-card>
      </el-col>-->
      <!--      <el-col :xs="24" :sm="24" :md="12" :lg="8">
              <el-card class="update-log">
                <template v-slot:header>
                  <div class="clearfix">
                    <span>捐赠支持</span>
                  </div>
                </template>
                <div class="body">
                  <img
                    src="https://oscimg.oschina.net/oscnet/up-d6695f82666e5018f715c41cb7ee60d3b73.png"
                    alt="donate"
                    style="width:100%"
                  />
                  <span style="display: inline-block; height: 30px; line-height: 30px"
                    >你可以请作者喝杯咖啡表示鼓励</span
                  >
                </div>
              </el-card>
            </el-col>-->
    </el-row>
  </div>
</template>

<script setup name="Index">
import {jobMonitor, hostConnectionTest} from "@/api/warn/apiMonitor";

const version = ref('1.0.0')

const jobMonitorLoading = ref(false)
const jobMonitorList = ref([])

const hostConnectionLoading = ref(false)
const hostConnectionList = ref([])

function goTarget(url) {
  window.open(url, '__blank')
}

function doJboMonitor(){
  jobMonitorLoading.value = true
  jobMonitor().then(resp => {
    jobMonitorList.value = resp.data
    jobMonitorLoading.value = false
  })
}

function doHostConnectionTest(){
  hostConnectionLoading.value = true
  hostConnectionTest().then(resp => {
    hostConnectionList.value = resp.data
    hostConnectionLoading.value = false
  })
}
</script>

<style scoped lang="scss">
.home {
  blockquote {
    padding: 10px 20px;
    margin: 0 0 20px;
    font-size: 17.5px;
    border-left: 5px solid #eee;
  }
  hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
  }
  .col-item {
    margin-bottom: 20px;
  }

  ul {
    padding: 0;
    margin: 0;
  }

  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #676a6c;
  overflow-x: hidden;

  ul {
    list-style-type: none;
  }

  h4 {
    margin-top: 0px;
  }

  h2 {
    margin-top: 10px;
    font-size: 26px;
    font-weight: 100;
  }

  p {
    margin-top: 10px;

    b {
      font-weight: 700;
    }
  }

  .update-log {
    ol {
      display: block;
      list-style-type: decimal;
      margin-block-start: 1em;
      margin-block-end: 1em;
      margin-inline-start: 0;
      margin-inline-end: 0;
      padding-inline-start: 40px;
    }
  }
}
</style>

